#include "main.h"

#include "stm32f4xx.h"
#include "usbd_cdc_core.h"
#include "usbd_usr.h"
#include "usb_conf.h"
#include "usbd_desc.h"

#ifdef USB_OTG_HS_INTERNAL_DMA_ENABLED
#if defined ( __ICCARM__ )      /* !< IAR Compiler */
#pragma data_alignment=4
#endif
#endif                          /* USB_OTG_HS_INTERNAL_DMA_ENABLED */

__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
#define USB_CDC_RX_BUFFER_SIZE  64
 #define USB_CDC_TX_BUFFER_SIZE  64

 uint8_t USB_CDC_RxBuffer[USB_CDC_RX_BUFFER_SIZE];
 uint8_t USB_CDC_TxBuffer[USB_CDC_TX_BUFFER_SIZE];


int main(void)

{
    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
    while(SysTick_Config(SystemCoreClock/1000)){};
  NVIC_SetPriority(SysTick_IRQn,0x00);
  __IO uint32_t i = 0;
    delay_ms(200);
      USBD_Init(&USB_OTG_dev,
#ifdef USE_USB_OTG_HS
           USB_OTG_HS_CORE_ID,
#else
           USB_OTG_FS_CORE_ID,
#endif
           &USR_desc, &USBD_CDC_cb, &USR_cb);
    delay_ms(200);
    
    //外设初始化配置
    bsp_init();
    //进入c++环境
    UserMain();
}
